//
//  XONoStockGoodsViewController.m
//  DDGMall
//
//  Created by 海丰丛 on 2020/3/9.
//  Copyright © 2020 lifayu. All rights reserved.
//

#import "XONoStockGoodsViewController.h"
#import "EJSShopCartGoodsCell.h"
#import "XOShoppingCartListRequest.h"
#import "EJSUpdateShopCartRequest.h"
#import "JSONKit.h"
#import "XOShoppingCartModel.h"

@interface XONoStockGoodsViewController () <UITableViewDataSource,UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation XONoStockGoodsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"库存不足";
}

///初始化
- (void)configOwnViews{

    [self.tableView registerNib:[UINib nibWithNibName:@"EJSShopCartGoodsCell" bundle:nil] forCellReuseIdentifier:@"EJSShopCartGoodsCell1"];
    self.tableView.tableFooterView = [UIView new];
    
}

#pragma mark TabelViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.shopModel.carts.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    EJSShopCartGoodsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"EJSShopCartGoodsCell1" forIndexPath:indexPath];
    cell.countLabel.hidden = YES;
    cell.minimumCountLabel.hidden = YES;
    cell.addButton.hidden = YES;
    cell.lessButton.hidden = YES;
    EJSShoppingCartGoodsModel *goodsModel = self.shopModel.carts[indexPath.row];
    [cell setShoppingGoodsCartModel:goodsModel];
    return cell;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
